//microcommand define nick
ctx = ctx.platform("onebot")
signature("<name:rawtext>", { checkUnknown: true, authority: 3 })
option("remove", "-r")
option("channel", "-g, -c, --guild, --group <id>", { descPath: "admin.channel-option", authority: 3 })
option("user", "-u <user:user>", { descPath: "admin.user-option" })
action(async ({ session, options }, name) => {
if (options.remove) name = ""
else if (!name) return session.text("internal.insufficient-arguments")
const channelId = options.channel?.slice(options.channel.split(":", 1)[0].length + 1) || session.channelId
const userId = options.user?.slice(options.user.split(":", 1)[0].length + 1) || session.selfId
await session.onebot.setGroupCard(channelId, userId, name)
session.onebot._request("set_msg_emoji_like", { message_id: session.messageId, emoji_id: 124 }).catch(() => {})
})
locale("zh-CN", { description: "设置群昵称", usage: "未指定目标用户时，设置 bot 自身的群昵称。", arguments: { name: "新昵称" }, options: { remove: "移除群昵称" } })